/**
 * 
 */
package krush.rezepte;

import krush.filechooser.FileChooser;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

/**
 * @author krush
 *
 */
public class Optionen extends Activity {
	
	@Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.options);
        
    }
	
	public void onButtonClick(View v)
	{
		EditText et = (EditText)findViewById(R.id.options_input); 
		if ( et.getText().toString().equals("wert12r"))
		{
			DBHelper dbh = new DBHelper(this);
			dbh.leereTable(dbh.RezTable);
			dbh.leereTable(dbh.SuchTable);
			Toast.makeText(this, "Alle Rezepte gelöscht!", Toast.LENGTH_SHORT).show();
		}
		else
		{
			Toast.makeText(this, "Falsches Passwort!", Toast.LENGTH_SHORT).show();
		}
	}
	
	public void onWiederherstellenClick(View v)
	{
	    Intent intent = new Intent(this, FileChooser.class);
	    startActivity(intent);
	    
	}

}
